package com.cq.hd.task.web.job;

import com.cq.hd.order.api.TbOrderSettleBillApi;
import com.cq.hd.order.api.TbOrderUnverifiedRecordApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 订单未核销金额处理
 *
 * @author much
 * @since 2024/09/30 21:45
 */
@Slf4j
@Component
public class OrderUnverifiedAmtTask {

    @Resource
    private TbOrderUnverifiedRecordApi orderUnverifiedRecordApi;
    @Resource
    private TbOrderSettleBillApi orderSettleBillApi;

    @XxlJob("scanOrderUnverifiedAmtTask")
    public void scanOrderUnverifiedAmtTask() {
        log.info("订单未核销金额处理");
        orderUnverifiedRecordApi.scanPendingRecords();
        log.info("订单未核销金额处理完成");
    }

    @XxlJob("scanOrderUnverifiedSettleBill")
    public void scanOrderUnverifiedSettleBill() {
        log.info("订单未核销结算单处理");
        orderSettleBillApi.scanRecoverAmtTransfer();
        log.info("订单未核销结算单处理完成");
    }

}
